<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Expenses-Login</title>
<meta name="keywords" content="" />
<meta name="description" content="" />
<meta name="format-detection" content="email=no,address=no,telephone=no" />
<meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no,minimal-ui" />
<script type="text/javascript" src="js/zepto.min.js"></script>
<script type="text/javascript" src="js/mediaFize.js"></script>
<script type="text/javascript" src="js/util.js"></script>
<script type="text/javascript" src="js/swiper-3.4.0.min.js"></script>
<link type="text/css" rel="stylesheet" href="css/home.css" />
<link type="text/css" rel="stylesheet" href="css/swiper-3.4.0.min.css" />
<link type="text/css" rel="stylesheet" href="css/index.css" />
<style>
</style>
</head>
<body>
<div id="pageSwaper">
	<div class="Expenses_index_bg">
		<div class="Expenses_moon">
			<i class="icon1"></i>
			<i class="icon2"></i>
			<i class="icon3"></i>
			<i class="icon4"></i>
		</div>
		<div class="Expenses_bg_icon">
			<div class="bg_input">
	    		<p class="title">请输入登录账号和密码</p>
	    		<div class="input">
	    			<label>账号 : </label>
	    			<input type="text" class="id" value="" maxlength="11" placeholder="请输入您的账号"/>
	    		</div>
	    		<div class="input">
	    			<label>密码 : </label>
	    			<input type="password" class="password" value="" maxlength="8" placeholder="请输入您的密码"/>
	    		</div>
	    		<div class="btn_area clearfix">
	    			<input type="button" class="to_modify" value="重置"/>
	    			<input type="button" class="to_login" value="确定"/>
    			</div>
    		</div>
		</div>
	</div>
</div>
<script>
	$(function(){
		var id;
		var password;
		window.onload=(function(){
			var minWidth=$(window).width();
			var minHeigth=$(window).height();
			$("#pageSwaper").css({"width":minWidth,"height":minHeigth});
			$(".user_footer").remove();
		})


		
	    
		$(".btn_area").on("click",".to_modify",function(){
			$(".input>input").forEach(function(){
				$(".input>input").val("");
			});
		})
		$(".btn_area").on('click','.to_login',function(){
		    //账户
		    id=$('.input .id').val();
			password=$('.input .password').val();
			if(id==''){
				showMaskEditCom({text: "请输入您的账户名",duration: 1500});
				return false;
			}
			//密码
			if(password==''){
				showMaskEditCom({text: "请输入您的密码",duration: 1500});
				return false;
			}
			$.ajax({
				url : './../login/userLogin',
				type:'POST',
				data:{
					userCode:id,
					passWd:password,
				},
				dataType:'json',
				success : function(result) {// 成功时的回调函数
					if(result.code == 1){
						window.location.href="homepage/index.html";
//						$.messager.alert('提示', result.msg,'info');
					}else{
						console.info(11);
						showMaskEditCom({text: "用户名跟密码错误",duration: 1500});
						return false;
						//$.messager.alert('提示', result.msg,'error');
					}
				}
			});

	    })
	});
</script>
</body>
</html>
